#include "battery_module.h"

void Battery_module::setParameter(string _parameter)
{
    parameter=_parameter;
}

void Battery_module::setExternal_power_supply(int _external_power_supply)
{
    external_power_supply=_external_power_supply;
}

void Battery_module::setCharging_duration(int _charging_duration)
{
    charging_duration=_charging_duration;
}



void Battery_module::print ()
{
    cout<<"电池模块"<<endl<<"a.参数："<< parameter<<endl<< "b.对外供电："<< external_power_supply<<"V"<<endl
    << "c.充电时长："<< charging_duration<<"H"<<endl;
}


void Battery_module::save (string path)
{
    ofstream ofs;// 创建流对象
    ofs.open(path, ios::out | ios::app);

    ofs<< "电池模块"<<endl<<"a.参数："<< parameter<<endl<< "b.对外供电："<< external_power_supply<<"V"<<endl
    << "c.充电时长："<< charging_duration<<"H"<<endl;

    ofs.close();
}
